﻿using System.Data.Objects;

namespace Common.Unity.Extensions.Entity
{
	public abstract class EntityCreationPolicyBase : EntityContextCreationPolicyBase<ObjectContext>
	{
		protected EntityCreationPolicyBase( ObjectContext objectContext, IEntityCreator creator )
			: base( objectContext, creator ?? new EntityCreator( objectContext ) )
		{
			objectContext.MetadataWorkspace.LoadFromAssembly( objectContext.GetType().Assembly );
		}
	}
}
